package impl

import (
	"net/http"

	"github.com/cloudwego/hertz/pkg/app"
	"github.com/cloudwego/hertz/pkg/common/utils"
)

type BaseService struct{}

func (receiver BaseService) Response(c *app.RequestContext, data any) {
	c.JSON(http.StatusOK, data)
}

func (receiver BaseService) BadRequestResponse(c *app.RequestContext, msg string) {
	c.JSON(http.StatusBadRequest, utils.H{
		"code":    400,
		"message": msg,
	})
}
